package com.z.blog.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.z.base.vo.PageVo;
import com.z.blog.entity.Message;
import com.z.blog.mapper.MessageMapper;
import com.z.blog.service.IMessageService;
import org.springframework.stereotype.Service;

import java.util.List;
/**
 * 留言Service业务层处理
 *
 * @author z
 * @date 2022-09-13
 */
@Service
public class MessageServiceImpl extends ServiceImpl<MessageMapper,Message> implements IMessageService {


    /**
     * 查询留言
     * @param message 留言
     * @param pageVo
     * @return 留言 分页集合
     * */
    @Override
    public PageInfo<Message> selectMessagePage(Message message, PageVo pageVo) {
        PageHelper.startPage(pageVo.getPage(), pageVo.getLimit());
        List<Message> data = baseMapper.selectMessageList(message);
        return new PageInfo<>(data);
    }

}
